package com.hctforgreen.greenservice.model;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 基本数据版本号
 * @author Tallen Zhai
 *
 */
public class DataVersionCodeEntity extends BaseEntity {

	private static final long serialVersionUID = 893855641600152622L;

	/**
	 * HctConstants.RESULT_STATE_SUCCESS
	 * HctConstants.RESULT_STATE_FAILD
	 * HctConstants.RESULT_STATE_EXCEPTION
	 */
	public String statusCode = "";
	
	public String versionCode = "";
	public String msg = "";
	public final static String STATE_CODE = "statusCode";
	public final static String VERSION_CODE = "versionCode";
	public final static String MSG = "msg";
	public static DataVersionCodeEntity parse(JSONObject jsonObject)throws JSONException{
		DataVersionCodeEntity bean = new DataVersionCodeEntity();
		if(jsonObject.has(STATE_CODE)){
			bean.statusCode = jsonObject.getString(STATE_CODE);
		}
		if(jsonObject.has(VERSION_CODE)){
			bean.versionCode = jsonObject.getString(VERSION_CODE);
		}
		if(jsonObject.has(MSG)){
			bean.msg = jsonObject.getString(MSG);
		}
		return bean;
	}
}
